(goto-char (point-max))
(insert "\n" fmt-msg "\n")))))
+(defsubst which-key--safe-lookup-key (keymap key)
+ "Version of `lookup-key' that allows KEYMAP to be nil.
+Also convert numeric results of `lookup-key' to nil. KEY is not
+checked."
+ (when (keymapp keymap)
+ (let ((result (lookup-key keymap key)))
+ (when (and result (not (numberp result)))
+ result))))
+
;;; Third-party library support
;;;; Evil
+(defvar evil-state nil)
+
(defcustom which-key-allow-evil-operators (boundp 'evil-this-operator)
"Allow popup to show for evil operators.
The popup is normally inhibited in the middle of commands, but
"If MAYBE-STRING is a string use `which-key--string-width' o/w return 0."
(if (stringp maybe-string) (string-width maybe-string) 0))
-(defsubst which-key--safe-lookup-key (keymap key)
- "Version of `lookup-key' that allows KEYMAP to be nil.
-Also convert numeric results of `lookup-key' to nil. KEY is not
-checked."
- (when (keymapp keymap)
- (let ((result (lookup-key keymap key)))
- (when (and result (not (numberp result)))
- result))))
-
(defsubst which-key--butlast-string (str)
(mapconcat #'identity (butlast (split-string str)) " "))
(t
(format "%s %s" current docstring)))))
-(defun which-key--format-and-replace (unformatted &optional prefix preserve-full-key)
+(defun which-key--format-and-replace (unformatted &optional preserve-full-key)
"Take a list of (key . desc) cons cells in UNFORMATTED, add
faces and perform replacements according to the three replacement
alists. Returns a list (key separator description)."
(when which-key-sort-order
(setq unformatted
(sort unformatted which-key-sort-order)))
- (which-key--format-and-replace unformatted prefix recursive)))
+ (which-key--format-and-replace unformatted recursive)))
;;; Functions for laying out which-key buffer pages